/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.amuthu.expression.function.indicator;

import org.amuthu.DataStore;
import org.amuthu.expression.Expression;
import org.amuthu.indicator.BollingerLower;
import org.amuthu.parser.ExpressionVisitor;

/**
 *bollinger_lower(period,deviation,startOffset);
 * @author prabhu
 */
public class BollingerLowerFunction extends BollingerFunction
{
   public BollingerLowerFunction()
   {
   }

   @Override
   public double calculateIndicator(DataStore dataStore, Expression[] arguments, ExpressionVisitor visitor)
   {
      BollingerLower bollingerUpper = new BollingerLower(dataStore, getPeriod(), getDeviation(), getOffset());

      return bollingerUpper.calculate();
   }

   @Override
   public int calculateDependency(DataStore dataStore, Expression[] arguments, ExpressionVisitor visitor)
   {
      BollingerLower bollingerUpper = new BollingerLower(dataStore, getPeriod(), getDeviation(), getOffset());

      return bollingerUpper.getDayDependency();
   }

}
